I'm not sure where to write this but I've found an issue with integrating pkg and puppeteer. The puppeteer API has a method page.evaluate, accepting a function to be executed in the context of the page. This entails serializing the function and passing it over the socket to the Chromium process, to executed there. Implementation wise puppeteer calls toString() on said function.
But since pkg compiles scripts using v8::ScriptCompiler the sources are not kept. This means f.toString() will return something like 'function f() { [native code] }' to be passed over the socket. This will obviously fail with a rather cryptic error message: Error: Evaluation failed: SyntaxError: Unexpected identifier One workaround is to only pass strings to be evaluated as expressions to page.evaluate instead.
|